﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using Bookvar.ServiceModel;

namespace BookvarWpf
{
    /// <summary>
    /// Shows errors in a message box.
    /// TODO: this is a stub implementation. Improve it.
    /// </summary>
    public class ErrorService : IErrorService
    {
        /// <summary>
        /// Shows an error to the user.
        /// </summary>
        /// <param name="message">The message.</param>
        /// Use this when the error is not caused by a mistake in
        /// the application code, but it is caused by the user or his environment. For example
        /// an error is the lack of Internet connection or the user entering a wrong password.
        public void ShowError( string message )
        {
            // TOOD: localize
            MessageBox.Show( message, "Error", MessageBoxButton.OK, MessageBoxImage.Error );
        }

        /// <summary>
        /// Shows a warning to the user.
        /// </summary>
        /// <param name="message">The message.</param>
        public void ShowWarning( string message )
        {
            // TOOD: localize
            MessageBox.Show(message, "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
        }

        public void ShowApplicationError( string message )
        {
            throw new NotImplementedException();
        }

        public void ShowApplicationError( Exception exception )
        {
            throw new NotImplementedException();
        }
    }
}